package com.penghk.springbootdemo;

import io.swagger.models.auth.In;
import org.junit.Test;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ThreadLocalRandom;

/**
 * @author penghk
 */
public class alibabajavaguifan {

    //fixme
//    private static final ThreadLocal<DateFormat> dfd = ThreadLocal.withInitial()
    private static final ThreadLocal<DateFormat> df = new ThreadLocal<DateFormat>(){
        @Override
        protected DateFormat initialValue(){
            return new SimpleDateFormat("yyyymmdd");
        }
    };

    @Test
    public void test() {
//        Instant instant = new Instant();
        ThreadLocalRandom random = ThreadLocalRandom.current();
        random.nextInt();

        random.nextInt();
        random.doubles();
        System.out.println("完美");

        random.doubles();

        System.out.println("hello world");

        System.out.println(System.nanoTime());

        Instant instant = Instant.now();
        instant.getNano();

        instant.getNano();

        Map<String, Integer> items = new HashMap<>();
        items.put("A", 10);
        items.put("B", 20);
        items.put("C", 30);
        items.put("D", 40);
        items.put("E", 50);
        items.put("F", 60);
        items.forEach((k , v)->{
            System.out.println("key : "+k +" value : "+v);
        });
    }
}
